#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
  char buffer[101];
  memset(buffer,0,sizeof(buffer));
  const char *lable="|/-\\";
  int cnt = 0;
  while(cnt <= 100)
  {
    printf("[%-100s][%d%%][%c]\r", buffer, cnt, lable[cnt % 4]);
    fflush(stdout);
    buffer[cnt]= '=';
    cnt++;
    usleep(50000);
  }
  printf("\n");
  return 0;
}
